package com.zxc.domain;

import java.io.Serializable;

public class TableHeader implements Serializable{

	private static final long serialVersionUID = 1L;

	private String headerName;

	private String headerType;
	
	private String comment;
	
	private String num;

	public TableHeader() {
		super();
	}

	public TableHeader(String headerName, String headerType) {
		super();
		this.headerName = headerName;
		this.headerType = headerType;
	}

	public String getHeaderName() {
		return headerName;
	}

	public void setHeaderName(String headerName) {
		this.headerName = headerName;
	}

	public String getHeaderType() {
		return headerType;
	}

	public void setHeaderType(String headerType) {
		this.headerType = headerType;
	}

//	@Override
//	public int hashCode() {
//		final int prime = 31;
//		int result = 1;
//		result = prime * result
//				+ ((headerName == null) ? 0 : headerName.hashCode());
//		result = prime * result + headerType;
//		return result;
//	}
//
//	@Override
//	public boolean equals(Object obj) {
//		if (this == obj)
//			return true;
//		if (obj == null)
//			return false;
//		if (getClass() != obj.getClass())
//			return false;
//		final TableHeader other = (TableHeader) obj;
//		if (headerName == null) {
//			if (other.headerName != null)
//				return false;
//		} else if (!headerName.equalsIgnoreCase(other.headerName))
//			return false;
//		if (((headerType == Types.DOUBLE || headerType == Types.INTEGER) && other.headerType == Types.NUMERIC)
//				|| ((other.headerType == Types.DOUBLE || other.headerType == Types.INTEGER) && headerType == Types.NUMERIC)) {
//			return true;
//		}
//		if (headerType != other.headerType)
//			return false;
//		return true;
//	}
	

	public String getComment() {
		return comment == null?" ":comment;
	}

	public String getNum() {
		return num;
	}

	public void setNum(String num) {
		this.num = num;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((headerName == null) ? 0 : headerName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final TableHeader other = (TableHeader) obj;
		if (headerName == null) {
			if (other.headerName != null)
				return false;
		} else if (!headerName.equals(other.headerName))
			return false;
		return true;
	}

}
